home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / Asymptote Demo / Examples / Demos / 12) GSC star chart / readGSC < prev    next >
Encoding:
Text File  |  1994-05-07  |  712 b   |  30 lines  |  [TEXT/DWat]

  1. % Usage: readgsc GSCfilename
  2. % Reads a GSC file and stores values in x,y,p and l
  3.  
  4. % Sets:
  5. %        x = RA(2000) decimal hours
  6. %     y = DEC(2000) decimal degrees
  7. %     p = magnitude (also saved in r0)
  8. %     l = label (00001, 00002, etc.)
  9.  
  10. datafile &1
  11. % skip over the header of 53 lines
  12. datalines 54 53 maxpts +
  13. datacol 6 14                % set a mask to read the RA
  14. readcolumn x 1
  15. datacol 15 23                % mask to read the DEC
  16. readcol y 1
  17. rpn <x 15 / >x
  18. datacolumns 29 33            % mask to read magnitude
  19. readcol p 1
  20. rpn <p >r0                    % save magtitudes in r0
  21. datacolumns 1 5            % mask to read labels
  22. readcol l 1
  23.  
  24. drawtitle Hubble Guide Stars for field \f
  25.  
  26. % Close the data file to save memory
  27. closewindow &1
  28.  
  29. % Close myself since I am done
  30. close